From: Keir Fraser Date: Sat, 5 Apr 2008 21:25:30 +0000 (+0100) Subject: xend: Don't allow dom0 memory to be ballooned below dom0-min-mem X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14231^2~63 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=01d02daa5f6b48fab3aebc285c42c004cbb8784e;p=xen.git xend: Don't allow dom0 memory to be ballooned below dom0-min-mem configuration parameter. Signed-off-by: Masaki Kanno --- diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index ff5de1cd10..a88dfb4a3f 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -986,6 +986,13 @@ class XendDomainInfo: self.info['name_label'], str(self.domid), target) MiB = 1024 * 1024 + + if self.domid == 0: + dom0_min_mem = xoptions.get_dom0_min_mem() + memory_cur = self.get_memory_dynamic_max() / MiB + if target < memory_cur and dom0_min_mem > target: + raise XendError("memory_dynamic_max too small") + self._safe_set_memory('memory_dynamic_min', target * MiB) self._safe_set_memory('memory_dynamic_max', target * MiB)